//
//  KDDRegistration.h
//  MengLiao
//
//  Created by xiuxin on 2022/7/15.
//  Copyright © 2022 ZHBen. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "KDDHeader.h"
#import "KDDPosition.h"
#import "KDDRegisterInfo.h"

typedef NSString * (^KDDReuseIDBlock)(__kindof NSObject * model, KDDViewType viewType);

typedef Class (^KDDWrapperClassBlock)(NSString * reuseID, KDDViewType viewType);

typedef id (^KDDValueBlock)(__kindof NSObject * model, KDDPosition * position);

typedef void (^KDDEventHandler)(__kindof UIView * view, __kindof NSObject * model, KDDPosition * position);

@interface KDDConfig : NSObject <NSCopying>
//configID
@property (copy,nonatomic) NSString * configID;
//registration
@property (strong,nonatomic) NSMutableDictionary<NSString *,KDDRegisterInfo *> * registerInfo;
@property (copy,nonatomic) KDDWrapperClassBlock wrapperClassBlock;
@property (nonatomic) Class wrapperClass;
//reuseID
@property (copy,nonatomic) KDDReuseIDBlock reuseIDBlock;
@property (copy,nonatomic) NSString * reuseID;
//size
@property (copy,nonatomic) KDDValueBlock sizeBlock;
@property (strong,nonatomic) NSValue * itemSize;

- (void)configModel:(NSObject *)model;

- (void)setHandler:(KDDEventHandler)handler forEvent:(KDDEventType)event;

- (KDDEventHandler)handlerForEvent:(KDDEventType)event;

@end
